<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        console.log(this) //window
        // 普通函数中的this
        function fn(){
            console.log(this) //window
        }
        window.fn()
        // 对象方法里面的this
        const obj = {
            name:'andy',
            sayHi:function(){
                console.log(this) //obj
            }
        }
        obj.sayHi()
    </script>
</body>
</html>